﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Meraz.Core.Model
{
    [Serializable]
    public class PostValues : IXmlEntity
    {
        public PostValues()
        {
            Aliases = new List<string>();
            Links = new List<string>();
        }
        [XmlAttribute]
        public string ID { get; set; }
        public string BlogName
        {
            get { return this.BlogKeyType.ToString(); }
            set { this.BlogKeyType = (BlogKeyType)Enum.Parse(typeof(BlogKeyType), value); }
        }
        [XmlIgnore]
        public BlogKeyType BlogKeyType { get; set; }
        public string Permalink { get; set; }
        public DateTime Pubdate { get; set; }
        public string Title { get; set; }

        [XmlIgnore]
        public string Body { get; set; }
        public List<string> Aliases { get; set; }
        public List<string> Links { get; set; }

        [XmlIgnore]
        public bool HasAliases { get { return (Aliases != null) && (Aliases.Count > 0); } }

        [XmlIgnore]
        public bool HasLinks { get { return (Links != null) && (Links.Count > 0); } }

    }
}
